/**
 * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
 */

:root {
	--ck-sample-base-spacing: 2em;
	--ck-sample-color-white: #fff;
	--ck-sample-color-green: #279863;
}

body, html {
	padding: 0;
	margin: 0;

	font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	font-size: 16px;
	line-height: 22px;
}

body {
	height: 100%;
	color: #2D3A4A;
	background-image: url(../img/bg.png);
	background-repeat: no-repeat;
	background-position: 50% 100%;
	background-size: 100% auto;
}

body * {
	box-sizing: border-box;
}

a {
	color: #38A5EE;
}

abbr {
	border-bottom: 1px dotted #333;
	text-decoration: none;
}

.centered {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 var(--ck-sample-base-spacing);
}

/* --------- HEADER ---------------------------------------------------------------------------- */

header .centered {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
	min-height: 8em;
}

header h1 {
	margin: 0;
	font-size: 1em;
	display: inline-block;
}

header h1 a {
	display: inline-block;
	line-height: 0;
}

header h1 img {
	height: 3em;
}

header nav ul {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

header nav ul li {
	display: inline-block;
}

header nav ul li + li {
	margin-left: 1em;
}

header nav ul li a {
	font-weight: bold;
	text-decoration: none;
	color: #2D3A4A;
}

header nav ul li a:hover {
	text-decoration: underline;
}

header nav ul li:last-child a::before {
	content: url(../img/github.svg);
	width: 1.4em;
	height: 1.4em;
	display: inline-block;
	margin-right: .4em;
	position: relative;
	top: .3em;
}

header input {
	display: none;
}

header label {
	display: none;
}

/* --------- MAIN ------------------------------------------------------------------------------- */

main .message {
	padding: 0 0 var(--ck-sample-base-spacing);
	background: var(--ck-sample-color-green);
	color: var(--ck-sample-color-white);
}

main .message::after {
	content: "";
	z-index: -1;
	display: block;
	height: 10em;
	width: 100%;
	background: var(--ck-sample-color-green);
	position: absolute;
	left: 0;
}

main .message h1 {
	padding-top: var(--ck-sample-base-spacing);
	margin: 0 0 1em;
	font-size: 2.2em;
}

main .message p {
	font-size: 1.1em;
	line-height: 1.6em;
}

main .message p a {
	color: var(--ck-sample-color-white);
}

main #editor {
	background: var(--ck-sample-color-white);
	box-shadow: 2px 2px 2px rgba(0,0,0,.1);
	border: 1px solid #DFE4E6;			
	border-bottom-color: #cdd0d2;
	border-right-color: #cdd0d2;
}

main .ck.ck-editor {
	box-shadow: 2px 2px 2px rgba(0,0,0,.1);
}

main .ck.ck-content {
	font-size: 1em;
	line-height: 1.6em;
	margin-bottom: 0.8em;
	min-height: 200px;
	padding: 1.5em 2em;
}

main #references {
	margin: 4em 0 var(--ck-sample-base-spacing);
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax(320px, 1fr) );
	grid-gap: var(--ck-sample-base-spacing);
}

main #references > section {
	background: var(--ck-sample-color-white);
	border-radius: 2px;
	border: 1px solid #DFE4E6;			
	padding: var(--ck-sample-base-spacing);
	line-height: 1.8em;

	display: flex;
	flex-flow: column nowrap;
	justify-content: space-between;
}

main #references > section h2 {
	margin: .5em 0;
}

main #references > section p:first-of-type {
	flex: 1 0 auto;
}

main #references > section p:last-child {
	margin: calc(.25*var(--ck-sample-base-spacing)) 0 0;
}

main #references > section p:last-child a {
	background: #38A5EE;
	border-radius: 5px;
	padding: .4em 1em;
	color: var(--ck-sample-color-white);
	text-decoration: none;
	font-weight: bold;
	display: block;
	text-align: center;
}

main #references > section p:last-child a:hover {
	background: #218cd4;
}

/* --------- MAIN / DOCUMENT EDITOR --------------------------------------------------------------- */

main .document-editor {
	border: 1px solid #DFE4E6;
	border-bottom-color: #cdd0d2;
	border-right-color: #cdd0d2;
	border-radius: 2px;
	max-height: 700px;
	display: flex;
	flex-flow: column nowrap;
	box-shadow: 2px 2px 2px rgba(0,0,0,.1);
}

main .toolbar-container {
	z-index: 1;
	position: relative;
	box-shadow: 2px 2px 1px rgba(0,0,0,.05);
}

main .toolbar-container .ck.ck-toolbar {
	border-top-width: 0;
	border-left-width: 0;
	border-right-width: 0;
	border-radius: 0;
}

main .content-container {
	padding: var(--ck-sample-base-spacing);
	background: #eee;
	overflow-y: scroll;
}

main .content-container #editor {
	border-top-left-radius: 0;
	border-top-right-radius: 0;

	width: 15.8cm;
	min-height: 21cm;
	padding: 1cm 1cm 2cm;
	margin: 0 auto;
	box-shadow: 2px 2px 1px rgba(0,0,0,.05);
}

/* --------- FOOTER ------------------------------------------------------------------------------- */

footer {
	margin: calc(2*var(--ck-sample-base-spacing)) var(--ck-sample-base-spacing);
	font-size: .8em;
	text-align: center;
	color: rgba(0,0,0,.4);
}

/* --------- RWD ------------------------------------------------------------------------------- */

@media (max-width: 900px) {
	header .centered {
		padding-top: var(--ck-sample-base-spacing);
		padding-bottom: var(--ck-sample-base-spacing);
		flex-flow: column nowrap;
		align-items: stretch;
		min-height: unset;
	}

	header h1 {
		text-align: center;
		margin-bottom: var(--ck-sample-base-spacing);
	}

	header nav ul {
		text-align: center;
	}
}

@media (max-width: 600px) {
	header .centered {
		padding-left: 0;
		padding-right: 0;
	}

	header nav {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;		
		background: #fff;
		padding: 1em 0;
		transition: all .4s ease-out;
		transform: translateY(-100%);
		overflow: hidden;
	}

	header h1 {
		margin: 0;
	}

	header nav ul li {
		display: block;
		line-height: 3em;
		margin-bottom: 1px;
	}

	header nav ul li a {
		display: block;
	}

	header nav ul li a:hover {
		background: #eee;
	}

	header nav ul li + li {
		margin-left: 0;
	}

	header label {
		display: block;
		color: #fff;
		width: 40px;
		height: 40px;
		position: absolute;
		top: 10px;
		left: 10px;
		z-index: 1;
		transition: transform .2s ease-out;
		transform: rotate(0deg);
		background: url() center center no-repeat;
	}

	header input:checked ~ nav {
		transform: translateY(0%);
		box-shadow: 0 3px 3px rgba(0,0,0,.1);		
	}

	header input:checked ~ label {
		background-image: url();
		transform: rotate(180deg);
	}

	main #references {
		grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
	}
}